
package adapter.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class ByteArrayCodecFactory implements ProtocolCodecFactory
{

	public static ProtocolEncoder encoder;
	public static ProtocolDecoder decoder;

	public ByteArrayCodecFactory() {
		encoder = new ByteArrayEncoder();
		decoder = new ByteArrayDecoder();

	}
	public void setEncoder(ProtocolEncoder encoder)
	{
		this.encoder=encoder;
	}
	
	public void setDecoder(ProtocolDecoder decoder)
	{
		this.decoder=decoder;
	}
	

	public ProtocolEncoder getEncoder( IoSession ioSession ) throws Exception {
		return encoder;
	}
	

	public ProtocolDecoder getDecoder( IoSession ioSession ) throws Exception {
		return decoder;
	}

}
